﻿namespace USElections.TwitterLibrary.Classes
{
    using System.Runtime.Serialization;
    using Newtonsoft.Json;
    using TweetSharp;

    [JsonObject(MemberSerialization.OptIn), DataContract]
    public class MyTwitterUrl : MyTwitterEntity
    {
        // Methods
        public MyTwitterUrl()
        {
            this.Initialize();
        }

        public MyTwitterUrl(TwitterUrl url)
            : this()
        {
            this.Value = url.Value;
            this.MyStartIndex = url.StartIndex;
            this.MyEndIndex = url.EndIndex;
            this.ExpandedValue = url.ExpandedValue;
            this.Indices = url.Indices;
        }

        private void Initialize()
        {
            this.EntityType = TwitterEntityType.Url;
        }

        // Properties
        [DataMember, JsonProperty("expanded_url")]
        public virtual string ExpandedValue { get; set; }

        [DataMember, JsonProperty("url")]
        public virtual string Value { get; set; }
    }
}
